package cn.doctor.assistant.pad.ui.zhuanzhen;

import android.os.Bundle;

import com.blunderer.materialdesignlibrary.fragments.ViewPagerWithTabsFragment;
import com.blunderer.materialdesignlibrary.handlers.ViewPagerHandler;

/**
 * Created by Administrator on 2016/3/21.
 * 转诊
 */
public class TransferFragment extends ViewPagerWithTabsFragment {
    // 1 - 初始化（未转诊）2 - 已转诊
    private TransferListFragment mToTransferFragment;
    private TransferListFragment mTransferedFragment;

    public static TransferFragment newInstance() {
        return new TransferFragment();
    }

    @Override
    protected boolean expandTabs() {
        return false;
    }

    @Override
    public int defaultViewPagerPageSelectedPosition() {
        return 0;
    }

    @Override
    public ViewPagerHandler getViewPagerHandler() {
        {
            mToTransferFragment = new TransferListFragment();
            Bundle bundle = new Bundle();
            bundle.putInt("isTransfer", 1);
            mToTransferFragment.setArguments(bundle);
        }

        {
            mTransferedFragment = new TransferListFragment();
            Bundle bundle = new Bundle();
            bundle.putInt("isTransfer", 2);
            mTransferedFragment.setArguments(bundle);
        }

        return new ViewPagerHandler(getActivity())
                .addPage("待转诊病人", mToTransferFragment)
                .addPage("已转诊病人", mTransferedFragment);
    }
}
